home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ODPrcs.h
-
- Contains: OpenDoc Process runtime functions
-
- Owned by: Tantek Çelik
-
- Copyright: © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <3> 3/1/96 JP 1314798: Added param to
- VerifyAndLaunchDocumentStub
- <2> 1/15/96 JA 1269485: Added GetPrefsFileSpec.
- <19> 10/25/95 TÇ 1281409 GM: OpenDoc needs an AboutBox.
- <18> 10/12/95 eeh 1287143: add keyODRefnumFromResource
- <17> 6/2/95 TÇ Need to copy resources into newly created
- documents. Completes fix to 4
- BB:1233106,1242232, 1254312, 1242283
- <16> 5/19/95 TÇ 1155852 BB: String constants need to be
- moved to resource for Localization, 1249396
- (was BB) OpenDoc shell should serialize
- stationery creation.
- <15> 4/29/95 TÇ 1216130 BB: Shell should open top draft
- upon receipt of open document Apple event
- <14> 4/24/95 eeh 1240662: define keyODActivateEventCause
- <13> 4/15/95 TÇ #1216915 DR/BB:Trying to open a document
- that is already open causes an error.
- <12> 4/7/95 eeh 1221297: eventID param to
- VerifyAndLaunchDocumentStub
- <11> 3/31/95 TÇ 1223465 BB: Opening and creating documents
- under low disk space. (Creating documents
- under low disk space part fixed).
- 1211032 BB: Invalid Permissions error
- opening locked document
- <10> 2/20/95 TÇ #1210979 BB: 5-$ Bugs need to be evaluated
- and removed from Shell
- #1221861 BB: Incomplete AOCE support needs
- to be removed from OpenDoc
- <9> 2/2/95 CG #1205177: "Editors" and "OpenDoc
- Libraries" folders are being registered
- with cfm (PPC only).
- <8> 1/6/95 jpa Added GetDescFSSpec [1198075]
- <7> 12/5/94 jpa Added GetLaunchFailedParams [1198075,
- 1158966]
- <6> 11/30/94 RR #1188078 include PlfmFile.h
- <5> 9/8/94 eeh #1185443: FileIsReadOnly() and contants for
- mailer info.
- <4> 8/29/94 TÇ #1158280 OpenDoc™ should not overwrite old
- stationery files when creating new ones
- <3> 8/25/94 TÇ #1183223 Enabled launching of documents in
- folders other than that of the OpenDoc
- libraries. Added new call:
- VerifyAndLaunchDocument
- <2> 8/22/94 TÇ #1182448 System Process quits when no
- OpenDoc documents are running
- <1> 8/22/94 TÇ first checked in
-
- In Progress:
-
- */
-
- #ifndef _ODPRCS_
- #define _ODPRCS_
-
- #define ppcinterfaces /* keeps GX headers quiet */
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- #ifndef _PLFMFILE_
- #include "PlfmFile.h"
- #endif
-
- #ifndef __DIALOGS__
- #include "Dialogs.h"
- #endif
-
-
- //==============================================================================
- // Constants
- //==============================================================================
-
- const ODSShort kMaxFileNameSize = 64;
- const ODULong kSpaceNeededForNewDocument = 32767/1024;
-
- const DescType kODActivateEvent = 0x61637476; // 'actv';
- const DescType keyODActivateEventCause = 0x77687961; // 'whya';
- const DescType keyODRefnumFromResource = 0x72667273; // 'rfrs';
-
- //==============================================================================
- // Functions
- //==============================================================================
-
- ODFileSpec GetOpenDocLibsFldrSpec();
-
- ODFileSpec GetOpenDocBinaryFileSpec(char* binaryName);
-
- OSErr GetPrefsFileSpec(ODFileSpec* prefFileSpec);
-
- #ifdef NEEDSYSTEMPROCESS
- ODBoolean IsODSysProcessRunning();
- #endif
-
- ODBoolean AreODDocumentsRunning();
-
- OSErr FileIsReadOnly( ODFileSpec* fs, ODBoolean* result );
-
- ODULong GetVolumeWritableSpace(ODFileSpec* fs, ODULong* error);
- // returns number of writeable K bytes avail on volume that the fs is on.
-
- OSErr GetDescFSSpec( AEDesc *, FSSpec & );
-
- // Document Launching
-
- OSErr VerifyDocumentStub(FSSpecPtr documentStub, FSSpec* seedFSSPtr);
- OSErr LaunchDocumentStub(AEDesc* theDocument, FSSpec* documentStub,
- AEDesc* theAlias, AEDescList* otherParams, ProcessSerialNumber* psn,
- DescType eventID);
-
- OSErr VerifyAndLaunchDocumentStub(AEDesc *theDocument,
- AEDescList* otherParams, ProcessSerialNumber *launchedPSN,
- DescType eventID, FSSpec* seedFSSPtr, ODBoolean unsavedDoc = kODFalse);
-
- DialogPtr ShowAboutScreen( );
-
- const DescType kCFMLaunchFailedEventClass = 'dave';
- const DescType kCFMLaunchFailedEventID = 'sean';
-
- void GetLaunchFailedParams( AppleEvent*, long &launchErr, ProcessSerialNumber *psn,
- Str255 appName, Str255 libName );
- ODBoolean WasLaunchedThenActivate(
- FSSpec* fileSpec,
- DescType eventID,
- OSErr & err);
-
-
- /*****************************************************************************/
-
- typedef short *RefNumPtr;
-
- /* Constants to specify the file fork GetLocalPaths should match */
- enum
- {
- kDataFork = 0,
- kResourceFork = 1
- };
- typedef short ForkType;
-
- /*****************************************************************************/
-
- pascal OSErr GetLocalPaths(FSSpec *spec,
- ForkType fork,
- unsigned long *refNumCount,
- RefNumPtr *refNums);
- /* Determine if local access paths to a file fork are open.
- The GetLocalPaths function looks through the FCB list to see if
- the fork of the file specified by spec and fork is open by the
- local File Manager (you should use PBGetCatInfo and check
- ioFlAttrib if you need to see if *anyone* has the file fork open
- *anywhere*). If the result is noErr, GetLocalPaths returns a
- count and a pointer to an array of file refNums (if count is
- not zero) of local access paths to the specified file fork.
-
- spec input: An FSSpec record specifying the file.
- fork input: Specifies the file fork - either kDataFork
- or kResourceFork.
- refNumCount output: The number of local access paths found.
- refNums output: If not NULL, a pointer to an array of
- file refNums - the number of which is
- specified by refNumCount. The caller is
- responsible for disposing of this pointer.
- */
-
-
- #endif /* _ODPRCS_ */
-